<a href='https://github.com/angular/angular.js/edit/v1.5.x/src/ngMock/angular-mocks.js?message=docs($componentController)%3A%20describe%20your%20change...#L2218' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.5.8/src/ngMock/angular-mocks.js#L2218' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">$componentController</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
  

    <li>
      - service in module <a href="api/ngMock">ngMock</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p>A service that can be used to create instances of component controllers.</p>
<div class="alert alert-info">
Be aware that the controller will be instantiated and attached to the scope as specified in
the component definition object. If you do not provide a <code>$scope</code> object in the <code>locals</code> param
then the helper will create a new isolated scope as a child of <code>$rootScope</code>.
</div>
</div>






<div>
  

    

  <h2 id="usage">Usage</h2>
    
      <p><code>$componentController(componentName, locals, [bindings], [ident]);</code></p>


    

    
<section class="api-section">
  <h3>Arguments</h3>

<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        componentName
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>the name of the component whose controller we want to instantiate</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        locals
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-object">Object</a>
      </td>
      <td>
        <p>Injection locals for Controller.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        bindings
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-object">Object</a>
      </td>
      <td>
        <p>Properties to add to the controller before invoking the constructor. This is used
                          to simulate the <code>bindToController</code> feature and simplify certain kinds of tests.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        ident
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>Override the property name to use when attaching the controller to the scope.</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

</section>
    
    <h3>Returns</h3>
<table class="variables-matrix return-arguments">
  <tr>
    <td><a href="" class="label type-hint type-hint-object">Object</a></td>
    <td><p>Instance of requested controller.</p>
</td>
  </tr>
</table>

  
  
  



  
</div>


